﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Treasure
{
    /// <summary>
    /// win_NewEdit.xaml 的交互逻辑
    /// </summary>
    public partial class win_NewEdit : Window
    {
        public win_NewEdit()
        {
            InitializeComponent();
        }
        public string SetName;
        public delegate void NameValue(string name);
        public NameValue nameValue;
        
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            nameValue(tbox_name.Text);
            this.DialogResult = true;
            this.Hide();

        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {           
            this.DialogResult = false;
            this.Hide();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (SetName != null)
            {
                tbox_name.Text = SetName;
            }
        }
    }
}
